-
-
Notifications
You must be signed in to change notification settings - Fork 859
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Width of column #2033
Comments
hello , this documentation might help. |
I read the documentations, tried parameters width in column, but still can not set width. I used inline style but table autowided itself. |
what datatable version you are using ? |
9.0 last version. bootstrap 4 |
hey, @djdony I guess the problem is you have written |
The ->width() method applies a width attribute to the |
@mariopro thanks for the info about width, not aware of it. You can already add a style using the magic method since Column is a Fluent class. But it would be nice to add a method for better IDE support. Column::make('name')->style('width: 150px; color: red'), |
Thanks @yajra for your prompt reply. That's great news and in fact works, yet as you say, IDE does not recognize the method. Nevetheless, it works :) Thank you! |
This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
I solved it this way by using editColumn and creating a blade file with a static width DataTable file (e.g GDPBeneficiariesTrainedDataTable): class GDPBeneficiariesTrainedDataTable extends DataTable
{
public function dataTable($query)
{
return datatables()
->eloquent($query)
->addIndexColumn()
....
->editColumn('shg_id', function ($data) {
$data['value'] = $data->shg_id;
$data['width'] = "200px";
return view('datatables.width-column', $data);
})
....
}
.... Blade file (e.g datatables.width-column) <div cstyle="width:{{$width}}">
{{ $value}}
</div> |
Summary of problem or feature request
Hi. i can not set width for column Age. I tried to change in head
But still does not apply width.
Code snippet of problem
$(document).ready(function(){
System details
The text was updated successfully, but these errors were encountered: