Tech or Treat! Write an article about your scariest tech disaster to win gadgets!Learn more

x
?
Solved

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

Posted on 2013-01-24
2
Medium Priority
?
413 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I have answered several questions lately that were solved utilizing the power of jQuery's AJAX functions, so I thought I would write an article demonstrating the ease of use. Why should I use jQuery as opposed to regular JavaScript? Now I know…
Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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…

647 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