Solved

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

Posted on 2013-01-24
2
405 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:knowlton
2 Comments
 
LVL 8

Accepted Solution

by:
soupBoy earned 500 total points
Comment Utility
$('.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:knowlton
Comment Utility
This worked perfectly!

Thanks,

Tom
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
The viewer will learn how to dynamically set the form action using jQuery.
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…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now