A question about user controls & alignment.

  • Thread starter Robert Koritnik
  • Start date
R

Robert Koritnik

I have a rather complicated question that at first seems simple. Let's say
you develop user controls consisting of a label, textbox (or any other input
control) a "more" (the one with three dots - ellipsis) button and a set of
hidden input boxes. Label on the left proceeded by the textbox (or...) and
on the right a "more" button.

The problem:
If we look at the page it would consist of two columns of this kind of
controls. A form with many controls of this kind (three visible elements)
would display them in a table of 7 columns:
- label
- textbox (or...)
- more button
- separating column
- label
- textbox (or...)
- more button

Everything would be aligns. Labels, textboxes and more buttons. But if you
need to build many user controls like this, a containing table would have 3
columns:
- control
- separating column
- control

So the problem. How would you align these pieces of all user controls
between each other? Fixed widths are not acceptable, while everything can
get messy with different screen resolution setting in the system. All should
be done using HTML w/o CSS...

Any suggestion would be greatly appreciated.
 
S

Scott G.

I'm not exactly sure what you are asking for; I think you are saying you have a control with three columns, wrapped in an HTML <table> and you want a group of them, so you would have a series of <table>s, thus how would you make sure they align, since the individual tables would align their own columns.

If that's what you are asking, then I would change the control to generate just the <tr>stuff</tr> and then write a wrapper control that contains only these kinds of controls and it would generate the <table> ...child controls here.. </table>

The better answer might be to create a templated control that you could get better control of the what you are generating (i.e. just create all of the controls but some delegate the actual presentation to another wrapper control....)

If that's not what you are asking.... then ignore this :).

Scott
I have a rather complicated question that at first seems simple. Let's say
you develop user controls consisting of a label, textbox (or any other input
control) a "more" (the one with three dots - ellipsis) button and a set of
hidden input boxes. Label on the left proceeded by the textbox (or...) and
on the right a "more" button.

The problem:
If we look at the page it would consist of two columns of this kind of
controls. A form with many controls of this kind (three visible elements)
would display them in a table of 7 columns:
- label
- textbox (or...)
- more button
- separating column
- label
- textbox (or...)
- more button

Everything would be aligns. Labels, textboxes and more buttons. But if you
need to build many user controls like this, a containing table would have 3
columns:
- control
- separating column
- control

So the problem. How would you align these pieces of all user controls
between each other? Fixed widths are not acceptable, while everything can
get messy with different screen resolution setting in the system. All should
be done using HTML w/o CSS...

Any suggestion would be greatly appreciated.
 
R

Robert Koritnik

You understood my question perfectly... I was asking exactly that. Yes. I
was thinking about TD solution so the control would only have the TD tags
and align them in the placeholder. But that's something I would really like
to avoid, because developer using those controls would have to have in mind
that HE must create the table, tr elements and put inside those controls.
Beside degner warnings/errors (maybe) because a table can contain only tr
(ok also tbody etc...) elements and tr can only contain td elements... So.
Making controls is beside reusability also a method to make usage of them to
the developer as much transparent as possible.

Once I did something simmilar with some control but it used javascript for
alignment. I made a result list control, that had fixed header and
scrollable results. And header had to align to results table. But I try to
avoid javascript as much as possible. Aspecially here.

Thans for your suggestions. But I was hoping of some totaly new approach
here. Ifyou have any other suggestions, you're more than welcome to present
more.

--
RobertK
{ Clever? No just smart. }


I'm not exactly sure what you are asking for; I think you are saying you
have a control with three columns, wrapped in an HTML <table> and you want a
group of them, so you would have a series of <table>s, thus how would you
make sure they align, since the individual tables would align their own
columns.

If that's what you are asking, then I would change the control to generate
just the <tr>stuff</tr> and then write a wrapper control that contains only
these kinds of controls and it would generate the <table> ..child controls
here.. </table>

The better answer might be to create a templated control that you could get
better control of the what you are generating (i.e. just create all of the
controls but some delegate the actual presentation to another wrapper
control....)

If that's not what you are asking.... then ignore this :).

Scott
I have a rather complicated question that at first seems simple. Let's say
you develop user controls consisting of a label, textbox (or any other
input
control) a "more" (the one with three dots - ellipsis) button and a set of
hidden input boxes. Label on the left proceeded by the textbox (or...) and
on the right a "more" button.

The problem:
If we look at the page it would consist of two columns of this kind of
controls. A form with many controls of this kind (three visible elements)
would display them in a table of 7 columns:
- label
- textbox (or...)
- more button
- separating column
- label
- textbox (or...)
- more button

Everything would be aligns. Labels, textboxes and more buttons. But if you
need to build many user controls like this, a containing table would have
3
columns:
- control
- separating column
- control

So the problem. How would you align these pieces of all user controls
between each other? Fixed widths are not acceptable, while everything can
get messy with different screen resolution setting in the system. All
should
be done using HTML w/o CSS...

Any suggestion would be greatly appreciated.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top