没有ID的CSS选择器

时间:2015-06-23 05:50:14

标签: css css3 sharepoint html-table

我正在尝试隐藏表格行,但我的表格没有ID。由于这是SharePoint代码,因此我无法在其中添加ID。

myFunUsingRandomList

我想隐藏上表的第4行。输入禁止ID但不知何故它不起作用

main

3 个答案:

答案 0 :(得分:0)

试试这个

  String hasPhone = cursor.getString(cursor.getColumnIndex(ContactsContract.Contacts.HAS_PHONE_NUMBER));

    if (hasPhone.equals(ContactsContract.Contacts.HAS_PHONE_NUMBER))
      //do your thing

<强> pattern rules

答案 1 :(得分:0)

只需将tr选择器与tr:nth-child(4) { display:none; } 标记一起使用即可。示例如下。

        @Override
        public void onTextChanged(CharSequence arg0, int arg1, int arg2,
                int arg3) {

        }

        @Override
        public void beforeTextChanged(CharSequence arg0, int arg1,
                int arg2, int arg3) {
            // TODO Auto-generated method stub

        }

        @Override
        public void afterTextChanged(Editable arg0) {
            String text = search_edit.getText().toString()
                    .toLowerCase(Locale.getDefault());
            adapter.filter(text);
        }

答案 2 :(得分:-1)

如果此行始终为最后一行,您可以选择隐藏最后一行(请检查代码段)。

如果它总是第四行,你可以将css更改为:

.ms-authoringcontrols:nth-child(4) {
  display: none;
}

.ms-authoringcontrols:nth-last-child(1) {
  display:none;
}
<td width="99%" class="ms-authoringcontrols">
            <table width="100%" class="ms-authoringcontrols">
            <tbody><tr><td>
                <input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$InputFile" title="Choose a file" class="ms-fileinput ms-fullWidth" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_InputFile" onfocus="ResetSpFormOnSubmitCalled();" onchange="CheckAssetLibMediaExtension()" type="file" size="35">
            </td></tr>
            <tr><td>
                <span class="ms-error" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl00" style="display: none;"><span role="alert">You must specify a value for the required field.</span></span>
                <span id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_ctl01" style="display: none;">The file name is invalid or the file is empty. A file name cannot contain any of the following characters: \ / : * ? " &lt; &gt; | # { } % ~ &amp;</span>
            </td></tr>
            <tr><td>
                <a id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OpenWithExplorerLink" accesskey="E" onclick="javascript:return !LaunchOpenInExplorer();" href="#">Upload files using Windows Explorer instead</a>
            </td></tr>

            <tr><td>
                <input name="ctl00$PlaceHolderMain$UploadDocumentSection$ctl05$OverwriteSingle" id="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OverwriteSingle" type="checkbox" checked="checked"><label for="ctl00_PlaceHolderMain_UploadDocumentSection_ctl05_OverwriteSingle">Overwrite existing files</label>
            </td></tr>

            </tbody></table>
        </td>