Super Sale Limited Time 50% OFF for All-Access Plans
Save 50% Now

How to change Datatable styling in laravel?


I can't follow Metronic's documentation for datables implementation since I'm following Yajra's.

I am trying to follow this:
https://preview.keenthemes.com/html/metronic/docs/general/datatables/subtable

The way I'm using datatable is per Yajra's docs:


<!--begin::Table-->
{{ $dataTable->table() }}
<!--end::Table-->

{{-- Inject Scripts --}}
@section("scripts")
{{ $dataTable->scripts() }}
@endsection


My datatable looks terrible:

How can I change the styling of this sub-table plus icon and change its position, without having to manually write <table> html and vanilla js?


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (1)


Hi DevMushref

In the original datatables documentation, there is an option to change the position of the plus icon. Please check this:



We have checked yajra/laravel-datatables plugin and we could not find a better option to make this customization. But we found a similar option:

https://github.com/yajra/laravel-datatables-html/blob/36fb107f41998ea0423932bc3a308a2a723e0fa4/src/Html/Options/Plugins/Responsive.php#L88


Thanks


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(