?
Solved

<th> tag -- I want to align the text left

Posted on 2013-01-24
2
Medium Priority
?
418 Views
Last Modified: 2013-01-24
Using jQuery, I want to align the indicated <th> tag to the left  (right now it is centered)

<th scope="col">Details</th>



Here is the code segment:

<table class="grid_view" cellspacing="0" id="ctl08_gvRepairItems" style="width:300px;border-collapse:collapse;">
		<tbody><tr class="grid_view_header">
			<th scope="col">&nbsp;</th><th scope="col">Repair Item</th><th scope="col">Units</th>







\\\\\\\\\\\  right now this is centered, I want to align it to the LEFT

<th scope="col">Details</th>







		</tr><tr id="ctl08_gvRepairItems_ctl02" onclick="HighLightGVRow('ctl08_gvRepairItems_ctl02', 'ctl08_gvRepairItems_ctl02_hdSelectedRow', 'ctl08_gvRepairItems_ctl02_hdOldStyle');">
			<td style="width:100px;">
                                            <a id="ctl08_gvRepairItems_ctl02_lnkDelete" href="javascript:__doPostBack('ctl08$gvRepairItems$ctl02$lnkDelete','')" style="display:inline-block;width:40px;">Delete</a>
                                        </td><td>
                                            <span id="ctl08_gvRepairItems_ctl02_lblRepairItem">Carpet Cleaning</span>
                                        </td><td>
                                            <span id="ctl08_gvRepairItems_ctl02_lblUnits">SF</span>
                                        </td><td>
                                            <span id="ctl08_gvRepairItems_ctl02_lblDetails" style="display: inline-block; width: 800px; text-align: left;">asfasd</span>
                                        </td><td><input type="hidden" name="ctl08$gvRepairItems$ctl02$hdSelectedRow" id="ctl08_gvRepairItems_ctl02_hdSelectedRow"><input type="hidden" name="ctl08$gvRepairItems$ctl02$hdOldStyle" id="ctl08_gvRepairItems_ctl02_hdOldStyle"></td>
		</tr>
	</tbody></table>

Open in new window

0
Comment
Question by:Tom Knowlton
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 2000 total points
ID: 38815895
$('.grid_view_header th:eq(3)').css({
    textAlign: 'left'
});

Open in new window


All this is doing is injecting inline styles....you can do this with css too, which would be a better way to do it....
0
 
LVL 5

Author Closing Comment

by:Tom Knowlton
ID: 38815911
This worked perfectly!

Thanks,

Tom
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question