Table Actions Column Label alignment
Hello All.
It might sound silly but I've been trying to figure out a way to just align the resource Actions column in the table view and I can't seem to find a way to achieve just that silly action.
By default all the Table columns have their content and labels aligned to the left, but the actions table column has a right alignment. Based on the documentation, I am able to align the actions themselves to left/right using helper classes, but what I am after is to set the alignment for the label itself.
To set the Actions column inside the resource table view I am using:
->actionsColumnLabel('Actions') (where 'Actions' is the desired column name).
Even though there is a helper class to align the actions for each row, I am struggling to find a way to provide an extra class or alignment to the label itself.
Also I am in a research of a way to add an icon to any table column to make the tables more expressing or UI appealing, however I seem to struggle to pass an icon() tag as well...
Any ideas or suggestions to have a simple and elegant solution?
11 Replies
I guess I can apply some custom style to the livewire component of the table, however I am after a simple and elegant way without too much tinkering of sources as to avoid any update break-ups later on π
Got a pic of what youβre trying to achieve? Not totally following you.
Hekki @awcodes
Yes, for sure I have a picture π Hope it explains it all better than 1000 words π
So State Name column is having it's title and context aligned to left, but actions are aligned to right with their Actions text column name.
I can alignn the actions themselves to the left, but I did not find a way to alignt the column title to left as well
As I said, it is not that important, but it is a learning curve and I always pick the toughest tricks to complete so that I learn how to achieve it on the way π
Looks like itβs hard coded to be right if actionsColumnLabel is set. So, without a PR the easiest thing is to setup a custom theme and just target it with css to change it.
Well, I've added an issue report to see if that can be an improvement or just me wants it to be as such π
So far I am OK with the alignement, just it does not make much sense that we have the alignement for actions (for RTL or LTR) but we can't move the Actions table text to LTR/RTL π
Thanks for looking into this. I think on this I can consider the task as closed.. π
Seems odd to me too.
I will have a look at the code and apply the same alignement as the column actions and that should resolve the issue as we already have a parameter for them to be RTL<>LTR. It should be a simple fix, I just have not done mucg of PR as i just worked on my own or proprietary projects that are behind NDA and might be a bit rusty, but it will be just another learning curve π
Yea. PRs are pretty straight forward. Luke Downing has a great series on Laracasts. Maybe start with that.