?
Solved

Align tablecell controls

Posted on 2007-03-27
3
Medium Priority
?
1,237 Views
Last Modified: 2008-01-09
Hi experts.

Does anyone know how to align tablecell controls horizontally using .net (VB)? i have a table cell containing two controls : a time picker and a date picker (could not find a composite control?) and would like them to appear side by side in the cell.  Would prefer not to create another table column for appearance sake and there does not seem to be a way to split a cell?

Many thanks
0
Comment
Question by:jeanniex
[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
3 Comments
 
LVL 3

Expert Comment

by:Saber37886661
ID: 18805328
you can try and set the table cells HorizontalAlign to HorizontalAlign.Center.
It will probably not put them side to side though, so likely you will have to wrap them in another table, but if the tables border, cellpadding and cellspacing is set to '0' then the table is not visible and it will not affect your layout.

Hope it helps
0
 
LVL 1

Author Comment

by:jeanniex
ID: 18807474
Hi.

The horizontal alignment option does not work - nor combining this with "wrap" = false.
If I put another table in the cell and add a row to this with two cells - putting one control in each, they do appear side by side but not aligned horizontally.  Modifying the horizontalalignment of these tablecells does not seem to have the desired result either.
I am doing this in VB and not in the design view as I need to be able to add rows dynamically.
Any ideas?
thanks in advance
0
 
LVL 3

Accepted Solution

by:
Saber37886661 earned 1500 total points
ID: 18809466
If it helps, I always do mine in the editor/ code view and never the design mode, lol it always crashes my copy of visual studio! (even after the 255th re-install)
for me i just go:
Dim tab As New Table
Dim tr As New TableRow
Dim tc As New TableCell
tc.HorizontalAlign = HorizontalAlign.Center

but normally in c# (its alot easier in c#, the language structure is more logical(wait for the comments on that comment of mine!))

ok how about giving the table cells a CssClass, eg:
tc.CssClass() = "tdAlign"
then in your css just add
.tdAlign
{
     white-space:normal;
     text-align: center;
}
or you could add it to the top of your page.
<style>
.tdAlign
{
     white-space:normal;
     text-align: center;
}
</style>

if none of this helps, let me know, but for now, its bed time
0

Featured Post

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

Question has a verified solution.

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

New Relic: Our company recently started researching several products to figure out what were the best ways for us to increase our web page speed and to quickly identify performance problems that we may be having. One of the products we evaluated wa…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

719 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