将单列文本输入重新排列为多列

时间:2013-03-25 08:02:14

标签: jquery css jquery-jtable

我正在使用jTable进行我正在进行的项目,并想看看你们是否可以帮助解决我遇到的CSS问题。当我向jTable添加新记录时,我在弹出窗口的下面创建了一个jsfiddle。因为我有这么多行,它比可见屏幕更长。您是否认为通过一些CSS调整可以将其设为两个或三个列框?

http://jsfiddle.net/Euwsm/

我无法更改此表单的生成,因此它必须只是CSS。

表格的缩写版本如下:

<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front ui-dialog-buttons ui-draggable ui-resizable" style="position: absolute; height: auto; width: auto; top: 0px;" tabindex="-1" role="dialog" aria-describedby="ui-id-58" aria-labelledby="ui-id-59">
    <div class="ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix"><span id="ui-id-59" class="ui-dialog-title">Add new record</span>
        <button class="ui-button ui-widget ui-state-default ui-corner-all ui-button-icon-only ui-dialog-titlebar-close" role="button" aria-disabled="false" title="close"><span class="ui-button-icon-primary ui-icon ui-icon-closethick"></span><span class="ui-button-text">close</span>
        </button>
    </div>
    <div id="ui-id-58" style="width: auto; min-height: 0px; max-height: none; height: auto; display: block;" class="ui-dialog-content ui-widget-content">
        <form id="jtable-create-form" class="jtable-dialog-form jtable-create-form" action="/Demo/CreateStudent" method="POST">
            <div class="jtable-input-field-container">
                <div class="jtable-input-label">Institution Name</div>
                <div class="jtable-input jtable-text-input">
                    <input class="" id="Edit-[Institution Name]" type="text" name="[Institution Name]">
                </div>
            </div>
            <div class="jtable-input-field-container">
                <div class="jtable-input-label">RSE50 Name</div>
                <div class="jtable-input jtable-text-input">
                    <input class="" id="Edit-[Institution RSE50 Name]" type="text" name="[Institution RSE50 Name]">
                </div>
            </div>
            <div class="jtable-input-field-container">
                <div class="jtable-input-label">Legal Name</div>
                <div class="jtable-input jtable-text-input">
                    <input class="" id="Edit-[Interest Fax Institution]" type="text" name="[Interest Fax Institution]">
                </div>
            </div>
        </form>
    </div>
    <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
        <div class="ui-dialog-buttonset">
            <button type="button" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Cancel</span>
            </button>
            <button type="button" id="AddRecordDialogSaveButton" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" role="button" aria-disabled="false"><span class="ui-button-text">Save</span>
            </button>
        </div>
    </div>
</div>

由于

1 个答案:

答案 0 :(得分:6)

可以仅使用CSS将它们分成列。那就是使用CSS3列属性。但是,它不适用于IE。

#jtable-create-form {
  display: block;
  width: 450px;
  -moz-column-gap:40px;
  -webkit-column-gap:40px;
  column-gap:40px;
  -moz-column-count:2;
  -webkit-column-count:2;
  column-count:2;
}

以下是具有上述代码的工作示例http://jsfiddle.net/shodaburp/Euwsm/1/